package com.itcz.cli.command;

import cn.hutool.core.util.ReflectUtil;
import com.itcz.model.MainTemplateConfig;
import picocli.CommandLine;

import java.lang.reflect.Field;

/**
 * config子命令逻辑
 */
@CommandLine.Command(name = "config", description = "查看参数信息", mixinStandardHelpOptions = true)
public class ConfigCommand implements Runnable{
    @Override
    public void run() {
        System.out.println("查看参数信息");
        // 通过Hutool工具包提供的方法获取MainTemplateConfig类所有的属性
        Field[] fields = ReflectUtil.getFields(MainTemplateConfig.class);
        // 循环遍历输出参数类型和名称
        for (Field field : fields) {
            System.out.println("参数类型：" + field.getType());
            System.out.println("参数名称：" + field.getName());
        }
    }
}
